;;; javascript.cfg.el --- Summary
;;; Commentary:
;;; JavaScript configuration
;;; Code:

(require 'package.cfg)

(package-install-if-absent 'js2-mode)
(package-install-if-absent 'js-comint)
(use-package js2-mode
  :init
  (add-hook 'js2-mode-hook 'yas-minor-mode)
  (add-hook 'js2-mode-hook 'flycheck-mode)
  :config
  (setq js2-basic-offset 2)
  (setq js2-indent-switch-body t)
  :mode ("\\.js\\'" . js2-mode)
  ;; Requires nodejs to be in $PATH
  :interpreter ("node" . js2-mode))

(use-package js-mode
  :mode ("\\.json$" . js-mode))

(use-package js-comint)

(provide 'javascript.cfg)
;;; javascript.cfg.el ends here
